.class public Lorg/microemu/util/JadProperties;
.super Ljava/util/Properties;
.source "JadProperties.java"


# static fields
.field static MIDLET_PREFIX:Ljava/lang/String; = null

.field private static final serialVersionUID:J = 0x1L


# instance fields
.field correctedJarURL:Ljava/lang/String;

.field midletEntries:Ljava/util/Vector;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 37
    const-string v0, "MIDlet-"

    sput-object v0, Lorg/microemu/util/JadProperties;->MIDLET_PREFIX:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 33
    invoke-direct {p0}, Ljava/util/Properties;-><init>()V

    .line 39
    iput-object v0, p0, Lorg/microemu/util/JadProperties;->midletEntries:Ljava/util/Vector;

    .line 41
    iput-object v0, p0, Lorg/microemu/util/JadProperties;->correctedJarURL:Ljava/lang/String;

    return-void
.end method


# virtual methods
.method public clear()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 44
    invoke-super {p0}, Ljava/util/Properties;->clear()V

    .line 46
    iput-object v0, p0, Lorg/microemu/util/JadProperties;->midletEntries:Ljava/util/Vector;

    .line 47
    iput-object v0, p0, Lorg/microemu/util/JadProperties;->correctedJarURL:Ljava/lang/String;

    .line 48
    return-void
.end method

.method public getConfiguration()Ljava/lang/String;
    .locals 1

    .prologue
    .line 67
    const-string v0, "MicroEdition-Configuration"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getJarSize()I
    .locals 1

    .prologue
    .line 83
    const-string v0, "MIDlet-Jar-Size"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public getJarURL()Ljava/lang/String;
    .locals 1

    .prologue
    .line 71
    iget-object v0, p0, Lorg/microemu/util/JadProperties;->correctedJarURL:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 72
    iget-object v0, p0, Lorg/microemu/util/JadProperties;->correctedJarURL:Ljava/lang/String;

    .line 74
    :goto_0
    return-object v0

    :cond_0
    const-string v0, "MIDlet-Jar-URL"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public getMidletEntries()Ljava/util/Vector;
    .locals 9

    .prologue
    .line 90
    iget-object v6, p0, Lorg/microemu/util/JadProperties;->midletEntries:Ljava/util/Vector;

    if-nez v6, :cond_1

    .line 91
    new-instance v6, Ljava/util/Vector;

    invoke-direct {v6}, Ljava/util/Vector;-><init>()V

    iput-object v6, p0, Lorg/microemu/util/JadProperties;->midletEntries:Ljava/util/Vector;

    .line 93
    invoke-virtual {p0}, Lorg/microemu/util/JadProperties;->propertyNames()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 94
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    .line 95
    .local v5, test:Ljava/lang/String;
    sget-object v6, Lorg/microemu/util/JadProperties;->MIDLET_PREFIX:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 97
    :try_start_0
    sget-object v6, Lorg/microemu/util/JadProperties;->MIDLET_PREFIX:Ljava/lang/String;

    invoke-virtual {v6}, Ljava/lang/String;->length()I

    move-result v6

    invoke-virtual {v5, v6}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    .line 98
    invoke-virtual {p0, v5}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 99
    const/16 v6, 0x2c

    invoke-virtual {v5, v6}, Ljava/lang/String;->indexOf(I)I

    move-result v4

    .line 100
    .local v4, pos:I
    const/4 v6, 0x0

    invoke-virtual {v5, v6, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v3

    .line 101
    .local v3, name:Ljava/lang/String;
    add-int/lit8 v6, v4, 0x1

    const/16 v7, 0x2c

    add-int/lit8 v8, v4, 0x1

    invoke-virtual {v5, v7, v8}, Ljava/lang/String;->indexOf(II)I

    move-result v7

    invoke-virtual {v5, v6, v7}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    .line 102
    .local v2, icon:Ljava/lang/String;
    const/16 v6, 0x2c

    add-int/lit8 v7, v4, 0x1

    invoke-virtual {v5, v6, v7}, Ljava/lang/String;->indexOf(II)I

    move-result v6

    add-int/lit8 v6, v6, 0x1

    invoke-virtual {v5, v6}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    .line 103
    .local v0, className:Ljava/lang/String;
    iget-object v6, p0, Lorg/microemu/util/JadProperties;->midletEntries:Ljava/util/Vector;

    new-instance v7, Lorg/microemu/util/JadMidletEntry;

    invoke-direct {v7, v3, v2, v0}, Lorg/microemu/util/JadMidletEntry;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v6, v7}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 104
    .end local v4           #pos:I
    .end local v3           #name:Ljava/lang/String;
    .end local v2           #icon:Ljava/lang/String;
    .end local v0           #className:Ljava/lang/String;
    :catch_0
    move-exception v6

    goto :goto_0

    .line 110
    .end local v1           #e:Ljava/util/Enumeration;
    .end local v5           #test:Ljava/lang/String;
    :cond_1
    iget-object v6, p0, Lorg/microemu/util/JadProperties;->midletEntries:Ljava/util/Vector;

    return-object v6
.end method

.method public getProfile()Ljava/lang/String;
    .locals 1

    .prologue
    .line 63
    const-string v0, "MicroEdition-Profile"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getProperty(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "key"

    .prologue
    .line 123
    invoke-super {p0, p1}, Ljava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 124
    .local v0, result:Ljava/lang/String;
    if-eqz v0, :cond_0

    .line 125
    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    .line 127
    :goto_0
    return-object v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "key"
    .parameter "defaultValue"

    .prologue
    .line 114
    invoke-super {p0, p1, p2}, Ljava/util/Properties;->getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 115
    .local v0, result:Ljava/lang/String;
    if-eqz v0, :cond_0

    .line 116
    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    .line 118
    :goto_0
    return-object v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public getSuiteName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 51
    const-string v0, "MIDlet-Name"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getVendor()Ljava/lang/String;
    .locals 1

    .prologue
    .line 59
    const-string v0, "MIDlet-Vendor"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getVersion()Ljava/lang/String;
    .locals 1

    .prologue
    .line 55
    const-string v0, "MIDlet-Version"

    invoke-virtual {p0, v0}, Lorg/microemu/util/JadProperties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public setCorrectedJarURL(Ljava/lang/String;)V
    .locals 0
    .parameter "correctedJarURL"

    .prologue
    .line 79
    iput-object p1, p0, Lorg/microemu/util/JadProperties;->correctedJarURL:Ljava/lang/String;

    .line 80
    return-void
.end method
